Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Create gluetun-docker-compose.yaml #152

Closed
wants to merge 10 commits into from
Closed

Conversation

bigsk1
Copy link

@bigsk1 bigsk1 commented May 30, 2024

Extend perplexica with VPN

Tested and working, also works with ollama locally!

Just need your VPN creds.

More info on gluetun vpn settings https://github.com/qdm12/gluetun

to run use

docker compose -f gluetun-docker-compose.yaml up -d --build

To remove

docker compose -f gluetun-docker-compose.yaml down

extend perplexica with VPN
@ItzCrazyKns
Copy link
Owner

Hi, thanks for the PR! I appreciate your efforts but I've never worked around with Glueten. Can you explain its use case within Perplexica?

@bigsk1
Copy link
Author

bigsk1 commented May 30, 2024

Hi, thanks for the PR! I appreciate your efforts but I've never worked around with Glueten. Can you explain its use case within Perplexica?

Every request outside your netwrok is on a VPN

You build a VPN container and all others containers can run inside it, you can still access all your webui's locally, been using Gluetun for a year now.

So when you go to Searxng in :4000 and type whats my ip you get ip of vpn, when you send out requests with chatgpt or ollama it's all on VPN!

@ItzCrazyKns
Copy link
Owner

This seems like a nice idea. We also need to add documentation for this because not everyone is familiar with Glueten or Docker.

Adding documentation for use of gluetun vpn stack with Perplexica
adding servers file for gluetun-docker-compose.yaml easy startup for new users
@bigsk1
Copy link
Author

bigsk1 commented May 31, 2024

This seems like a nice idea. We also need to add documentation for this because not everyone is familiar with Glueten or Docker.

All added, thanks.

@schrer
Copy link

schrer commented Jun 7, 2024

Is it necessary to check in that massive servers.json? I don't know gluetun, but the documentation seems to suggest this list is also packaged in the gluetun docker image.

My opinion is also, that this compose file can be set up by anyone who is interested in using gluetun themselves. I would not need the gluetun compose and would definitely not want a 6.5MB untrusted and soon outdated json.
I am not project affiliated though, so just a third-party opinion.

@bigsk1
Copy link
Author

bigsk1 commented Jun 7, 2024

Is it necessary to check in that massive servers.json? I don't know gluetun, but the documentation seems to suggest this list is also packaged in the gluetun docker image.

My opinion is also, that this compose file can be set up by anyone who is interested in using gluetun themselves. I would not need the gluetun compose and would definitely not want a 6.5MB untrusted and soon outdated json. I am not project affiliated though, so just a third-party opinion.

I can remove the servers.json if 6mb is to much for you, as the list does get updated by gluetun so won't be outdated, there is an env UPDATER=24h can also be added, your not going to use anyway sounds like and yes someone could do all this manually and try and figure out a yaml but it's already been done with Documentation. You don't want to use it great don't but for others wanting to or already have OpenVPN or Wireguard configs can easily get the whole setup running. You just don't want to see a extra .yaml in root or?

removing as to large for those that don't want 6mb of data and not using gluetun
@schrer
Copy link

schrer commented Jun 8, 2024

Ok, the auto update sounds nice. Then the maintainer of this repo doesn't need to take care of keeping the json up to date or ship an outdated one by default 👍

You just don't want to see a extra .yaml in root or?

There would be a large number of other equally useful things one could add. I personally like to keep these "addons" a bit separated if there is no necessity to be maintained within the main product. Smaller footprint for users who might not use it, less to maintain for the developer.
It's up to the maintainer to decide, whether gluetun is important enough to him/the application.

I don't doubt the usefulness of gluetun, but not everybody has a setup that needs it.

@schrer
Copy link

schrer commented Jun 8, 2024

Oh and a follow up
Is the volume mapping to the user home still used without the servers.json?
Would it make sense to set this UPDATER env var by default in the compose file, now that the default servers.json is no longer available?

@bigsk1
Copy link
Author

bigsk1 commented Jun 8, 2024

Oh and a follow up Is the volume mapping to the user home still used without the servers.json? Would it make sense to set this UPDATER env var by default in the compose file, now that the default servers.json is no longer available?

Update the VPN servers list

The VPN servers list used by Gluetun is the merged list from:

The built-in servers list can become outdated.
You can update your servers list /gluetun/servers.json, using the built-in update mechanisms.

Update periodically

By default this is disabled.

You can set the environment variable UPDATER_PERIOD to 24h for example. Every 24 hours, after the tunnel is ready, the container will update the servers information for the currently in-use VPN service provider. This has this advantage the update is done through the VPN and using DNS over TLS.

This periodic update can be extended to update data for other providers by setting them as a comma separated value in the environment variable UPDATER_VPN_SERVICE_PROVIDERS.

@ItzCrazyKns
Copy link
Owner

The idea of addons seems really nice. I will take a look into that, we (the community members) can together maintain another repository for the addons.

@bigsk1
Copy link
Author

bigsk1 commented Jun 24, 2024

The idea of addons seems really nice. I will take a look into that, we (the community members) can together maintain another repository for the addons.

Ya I have been using this setup for over a month now, no issues, works great and provides extra layer of privacy and security. Just let me know if you like me to do anything or feel free if you make another repo for addons to use this setup as needed. thanks.

@bigsk1
Copy link
Author

bigsk1 commented Oct 20, 2024

updated gluetun-docker-compose.yaml for those using this setup. Tested and working good.

services:
  gluetun:
    image: qmcgaw/gluetun:latest
    container_name: gluetun
    cap_add:
      - NET_ADMIN
    devices:
      - /dev/net/tun:/dev/net/tun
    volumes:
      - /home/Perplexica/gluetun:/gluetun
    environment:
      - VPN_SERVICE_PROVIDER=protonvpn
      - OPENVPN_USER=Cvvvvvvvvvvvvv
      - OPENVPN_PASSWORD=Jcccccccccccccc
      - SERVER_COUNTRIES=United States
      - SERVER_HOSTNAMES=node-us-CUSTOMIZE
      - TZ=America/Los_Angels
      - BLOCK_MALICIOUS=on 
      - BLOCK_SURVEILLANCE=on 
      - BLOCK_ADS=on
      - DOT=on
      - FIREWALL_OUTBOUND_SUBNETS=CUSTOMIZE
    networks:
      - perplexica-network
    ports:
      - 3001:3001
      - 3000:3000
      - 4000:8080
    restart: unless-stopped

  searxng:
    image: docker.io/searxng/searxng:latest
    volumes:
      - ./searxng:/etc/searxng:rw
    network_mode: 'service:gluetun'
    depends_on:
      - gluetun
    restart: unless-stopped

  perplexica-backend:
    build:
      context: .
      dockerfile: backend.dockerfile
    image: itzcrazykns1337/perplexica-backend:main
    volumes:
      - backend-dbstore:/home/perplexica/data
      - ./config.toml:/home/perplexica/config.toml
    depends_on:
      - gluetun
      - searxng
    network_mode: 'service:gluetun'
    restart: unless-stopped

  perplexica-frontend:
    build:
      context: .
      dockerfile: app.dockerfile
      args:
        - NEXT_PUBLIC_API_URL=http://192.168.70.54:3001/api
        - NEXT_PUBLIC_WS_URL=ws://192.168.70.54:3001
    image: itzcrazykns1337/perplexica-frontend:main
    depends_on:
      - gluetun
      - perplexica-backend
    network_mode: 'service:gluetun'
    restart: unless-stopped

networks:
  perplexica-network:

volumes:
  backend-dbstore:

@bigsk1 bigsk1 closed this Oct 20, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants